Conventionally, OS (operating systems) such as MS-Windows and UNIX, when storing data to an external storage device, have stored connections of individual clusters, blocks or the like in management data called an FAT (File Allocation Table) and an index node (i-node).
In such a system, when a file is read out, the clusters or blocks corresponding to that file are accessed in sequence while referring to the management information.
Additionally, when storing a new file or when rewriting data, conventionally, clusters or blocks for storing the new data sequence are allocated and the data is recorded to the allocated sectors after the management information is updated.
When accessing the file, if the management information stored in the external storage device and the data sequence have been accessed alternately, a seek to the external storage device occurs for each access, which is inefficient. In order to undertake efficient access, the management information is temporarily stored in the system buffer and the data sequence only is recorded in the external storage device. After the data sequence is recorded, the management information is recorded from the buffer to the external storage device.
However, in such a system, when recording data in the external storage device, in the event of a forced termination of the system, a system shutdown due to a power failure, or forced ejection of the removable storage medium when the external storage device is of the removal storage medium type and so forth, the management information that has been temporarily stored in the buffer is not recorded in the external storage device. When the management information is not recorded in the external storage device and the file is accessed after restoration from any of the above-mentioned interruptions, because the management information has not been recorded a problem occurs in that the entire data recorded on the storage medium sequence cannot be read out.
In order to deal with the above-described drawback the following methods have conventionally been proposed.
(1) Uninterruptible Power Supply Device Method
An uninterruptible power supply device is typically called a UPS (Uninterruptible Power Supply) device, and supplies electric power for a certain period of time even after the occurrence of a power failure such as a system main power interruption or voltage drop. By using UPS, the supply of electric power to the system after a system shutdown is interrupted. The shutdown enables the data sequence and the management information to be written to the external storage device and the system to be terminated normally, so the system can be terminated with control of the data sequence and the management information.
(2) Recoverable Delay Storage File System Method
This method is a method used in NTFS (New Technology File System) which is an MS-Windows NT file system, in which log information for recording disk access separately from the management information and the data sequence.
With this method, when there is a failure the device checks the recorded block information and, based on the log information, engages in a recovery process such that the management information and the data are consistent.
(3) Additional Storage File System Method
The write-once file system is typically called the LFS (Log-structured Files System) method. The LFS is a system that continuously adds data sequences in sequence and stores management information at the end of the data sequence.
With LFS, when the management information for the added data sequence has been stored, that data sequence becomes valid. It should be noted that if management information for the data sequence in the added storage cannot be stored due to a failure, then the data sequence in the added storage becomes invalid and a recovery process is carried out using the preceding data sequence.
FIG. 1 is a diagram for explaining the operation of one example of the conventional art. FIG. 1(A) shows a data composition of a write-once file system, FIG. 1(B) illustrates the operation of adding new information to the storage file system, and FIG. 1(C) is a diagram illustrating operation during a failure of the write-once file system.
With the write-once file system, as shown in FIG. 1(A) a single data sequence formed of blocks B1-B3 is managed by a single piece of management information 1. The management information 1 is made up of information such as the single data sequence file name, the file size, the lead block and the file allocation. Access to the files is conducted based on the management information 1.
For example, when blocks B4 and B5 are added as shown in FIG. 1(B), new management information 2 including management information for the newly stored blocks B4, B5 is produced. It should be noted that when the new management information 2 is produced, the management information 1 for managing blocks B1-B3 becomes invalid.
If the management information 2 is not stored due to failure when new blocks B4 and B5 are stored as shown in FIG. 1(C), the newly added blocks B4 and B5 become invalid. But, the management information 1 remains so that the blocks B1-B3 can be read based on the management information 1.
FIG. 2 is a diagram showing one example of the conventional management information and file data composition. FIGS. 2(A) and 2(B) show the management information 1 and FIGS. 2(C)-2(E) show the file data composition.
The management information 1 is composed of the file management information 1a shown in FIG. 2(A) and the block allocation information 1b shown in FIG. 2(B).
The file management information 1a is composed of the file name, file size and lead block number data. From the file management information 1a it can be determined that the file of the file name “xxxA” has 2560 bites from the lead block 1.
Additionally, as shown in FIG. 2(B) the block allocation information 1b is composed of block numbers of individual blocks and the succeeding block number following the individual block.
As shown in FIG. 2(C)-(E), the files are arranged such that data of individual file names “xxxA”, “xxxB” and “xxxC” is stored in blocks specified by the management information shown in FIGS. 2(A) and 2B.
For example, in order to access a file of the file name “xxxA”, first, reference is made to the lead block “1” of the file name “xxxA” of the file management information shown in FIG. 2(A) and the block of the lead block number “1” is accessed. Next, reference is made to the block number “1” of the block allocation information shown in FIG. 2(B), and the block of the block number “2” that is the next to be accessed is accessed.
Continuing, reference is made to the block number “2” of the block allocation information shown in FIG. 2(B), and the block of block number “3” that is the next to be accessed is accessed. Access continues in the same way, with the block allocation information shown in FIG. 2(B) being accessed to the final block. As described above, data from the blocks numbered “1” through “5”, in which the data of the file name “xxxA” is stored, is read out.
(4) Art disclosed in Japanese Laid-Open Patent Application No. 10-63555
In Japanese Laid-Open Patent Application No. 10-63555, a technique is described in which information for next indicating a block is included in the block for storing a data sequence and, if a discrepancy occurs between the management information and the stored data sequence, the management information is restored based on the information included in the block.
However, according to the conventional USP method of (1), the existence of a storage medium capable of storing data even during a failure is required, and suffers the disadvantage of being unable to cope when removable media are forcibly removed.
Similarly, the Recoverable Delay Storage File System Method shown in (2) and the Additional Storage File System Method shown in (3) conduct recovery based on effective management information content, so there is a possibility that newly stored data sequences will be discarded.
Moreover, with the method of Japanese Laid-Open Patent Application No. 10-63555 shown in (4), recovery of management information is conducted based on the information imbedded in the block, so it is necessary to access individual blocks of a data sequence in order. If the blocks have been stored randomly, however, then a seek occurs each time an individual block is accessed, creating the problem of necessitating processing time.
Similarly, recently applications have been proposed for storing a plurality of digital video images such as MPEG-1, MPEG-2 on an external storage device. With this sort of application, in order to record the digital video images that are continuously sent, it has been necessary to reduce overhead and carry out disk access efficiently. Disk access is composed of seek and rotational wait and data read processing. In order to hold down processes other than data read, it is desirable to record sequentially.
Here, with the method of Japanese Laid-Open Patent Application No. 10-63555 indicated in (4), in order to store the data sequence, it is necessary to store in one block information for the next block in order to make recovery from a failure possible. As a result, it is necessary to secure a location for the next block. Here, the case of a plurality of digital video images is considered. In order to store a plurality of digital video images without delay, it is necessary to schedule disk access according to the number of digital video image channels and the encoding rate and store a plurality of digital video image data sequentially. However, with the method of (4), when storing data to the next block, without regard to the disk access scheduling, there is a possibility that the information for the next block previously recorded to a block and the block might differ from the scheduled access order. As a result, random access occurs and disk access efficiency decreases. Accordingly, in order to store a plurality of digital video images, it is necessary to determine the block to be recorded based on the information at the time disk access is scheduled according to the number of video image channels and each video image transfer rate.